// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$CLEO .cs}

//-------------MAIN---------------
0000:

if
0AAB:   file_exists "models\txd\sm2018.txd"
then
0390: load_txd_dictionary 'sm2018' 
038F: load_texture "HUDLINEH" as 1
0ADF: add_dynamic_GXT_entry "N" text "N"
0ADF: add_dynamic_GXT_entry "E" text "E"
0ADF: add_dynamic_GXT_entry "S" text "S"
0ADF: add_dynamic_GXT_entry "W" text "W"
06D2: 8@v = "N" // @v = string
06D2: 9@v = "E"
06D2: 13@v = "S"
06D2: 14@v = "W"
else
0A93: end_custom_thread
end

3@ = -1 

03F0: enable_text_draw 1 
Model.Load(#MISSILE)
038B: load_requested_models 

:HUD_593
if 
   Model.Available(#MISSILE)
jf @HUD_616 
jump @HUD_627 

:HUD_616
wait 0 
jump @HUD_593 

:HUD_627
4@ = Object.Create(#MISSILE, 0.0, 0.0, 0.0)
Model.Destroy(#MISSILE)
Object.CollisionDetection(4@) = False
Object.KeepInMemory(4@) = True
0750: set_object 4@ visibility 0

:HUD_676
wait 0
0A8D: 10@ = read_memory 12840868 size 4 virtual_protect 0 
10@ *= 0.75 
0A8D: 11@ = read_memory 12677188 size 4 virtual_protect 0 
0A8D: 12@ = read_memory 12677192 size 4 virtual_protect 0 
0093: 27@ = integer 12@ to_float 
0093: 12@ = integer 11@ to_float 
0073: 12@ /= 27@ // (float) 
12@ *= 0.75 
if 
  11@ > 640 
jf @HUD_795 
11@ = 1 
jump @HUD_802 

:HUD_795
11@ = 0 

:HUD_802
27@ = Actor.Angle($PLAYER_ACTOR)
04C4: store_coords_to 21@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
04C4: store_coords_to 24@ 25@ 26@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0
0063: 24@ -= 21@ // (float) 
0063: 25@ -= 22@ // (float) 
0063: 26@ -= 23@ // (float) 
0087: 23@ = 27@ // (float) 
23@ += -90.0 
0087: 21@ = 24@ // (float) 
0087: 22@ = 25@ // (float) 
02F6: 28@ = sine 23@ // (float) 
02F7: 29@ = cosine 23@ // (float) 
006B: 21@ *= 29@ // (float) 
006B: 22@ *= 29@ // (float) 
006B: 24@ *= 28@ // (float) 
006B: 25@ *= 28@ // (float) 
22@ *= -1.0 
005B: 24@ += 22@ // (float) 
005B: 25@ += 21@ // (float) 
0087: 28@ = 24@ // (float) 
0509: 29@ = distance_between_XY 25@ 26@ and_XY 0.0 0.0 
gosub @HUD_14383 
0087: 7@ = 27@ // (float) 
04C4: store_coords_to 22@ 22@ 21@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -1.0
04C4: store_coords_to 22@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0 
if 
0025:   21@ > 23@ // (float) 
jf @HUD_1157 
7@ += -180.0 
7@ *= -1.0 

:HUD_1157
068D: get_camera_position_to 21@ 22@ 23@ 
068E: get_camera_target_point_to 24@ 25@ 26@ 
0063: 24@ -= 21@ // (float) 
0063: 25@ -= 22@ // (float) 
0063: 26@ -= 23@ // (float) 
050A: 30@ = distance_between_XYZ 24@ 25@ 26@ and_XYZ 0.0 0.0 0.0 
0073: 24@ /= 30@ // (float) 
0073: 25@ /= 30@ // (float) 
0073: 26@ /= 30@ // (float) 
0087: 28@ = 24@ // (float) 
0087: 29@ = 25@ // (float) 
gosub @HUD_14383 
0087: 23@ = 27@ // (float) 
0087: 28@ = 26@ // (float) 
0509: 29@ = distance_between_XY 24@ 25@ and_XY 0.0 0.0 
gosub @HUD_14383 
0087: 21@ = 27@ // (float) 
26@ = Actor.Angle($PLAYER_ACTOR)
0063: 26@ -= 23@ // (float) 
0656: get_angle 26@ absolute_degrees_to 26@ 
02F7: 26@ = cosine 26@ // (float) 
0087: 30@ = 26@ // (float) 
0097: make 30@ absolute_float 
0073: 26@ /= 30@ // (float) 
0A39: get_vehicle_camera_mode_to 30@ 
if 
047A:   actor $PLAYER_ACTOR driving_bike 
jf @HUD_1461 
0A96: 5@ = actor $PLAYER_ACTOR struct
5@ += 1608 
0A8D: 31@ = read_memory 5@ size 4 virtual_protect 0 
31@ *= 180.0 
31@ /= 3.141529 
005B: 7@ += 31@ // (float) 

:HUD_1461
31@ = 0.0 
if 
  30@ == 0 
jf @HUD_1520 
if or
80E1:   not player 0 pressed_key 5 
80E1:   not player 0 pressed_key 7 
jf @HUD_1520 
0087: 31@ = 7@ // (float) 

:HUD_1520
if 
  30@ > 60 //MITAD DE GRADOS VISIBLES
jf @HUD_1554 
0087: 31@ = 7@ // (float) 
006B: 31@ *= 11@ // (float) 

:HUD_1554
if 
   not 30@ == 60 //MITAD DE GRADOS VISIBLES
jf @HUD_1580 
006B: 7@ *= 26@ // (float) 

:HUD_1580
0063: 7@ -= 31@ // (float) 
0087: 22@ = 31@ // (float) 
22@ *= -1.0 
0453: set_object 4@ XY_rotation 21@ 23@ angle 22@ 
0087: 31@ = 22@ // (float) 
0087: 6@ = 23@ // (float) 
6@ *= -1.0 
0087: 5@ = 23@ // (float) 
5@ *= -1.0 
5@ += 360.0 
0092: 28@ = float 5@ to_integer 
28@ /= 10 
0093: 28@ = integer 28@ to_float 
28@ *= 10.0 
28@ += -50.0 
30@ = -59 //ANTERIOR DE LA MITAD DE GRADOS VISIBLES 

:HUD_1724
28@ += 10.0 
0087: 25@ = 28@ // (float) 
0063: 25@ -= 5@ // (float)
// DIVIDIR POR FACTOR DE ROTACION
25@ *= 0.065
// CALCULAR POSICION RELATIVA A WIDESCREEN
0AB1: call_scm_func @Proportional_size 1 82.5 15@
15@ -= 50.0
// SUMAR POSICION CALCULADA 
005B: 25@ += 15@  // (float)
//25@ += 65.0 
0092: 24@ = float 5@ to_integer 
24@ /= 2 
005A: 24@ += 30@ // (int)
24@ *= 2 
0085: 26@ = 24@ // (int)
//24@ /= 5
//24@ *= 5
0062: 24@ -= 26@ // (int) 
if 
  24@ == 0 
jf @HUD_2003
//0AB1: call_scm_func @Proportional_size 1 46.4 15@
//0AB1: call_scm_func @Proportional_size 1 25.0 16@
//005B: 16@ += 15@  // (float)                   
//038E: draw_box_position 16@ 330.4 size 68.0 24.0 RGBA 0 50 50 128
//03E3: set_texture_to_be_drawn_antialiased 11@
//03E3: set_texture_to_be_drawn_antialiased 11@
//074B: draw_texture 26 position 16@ 330.4 scale 70.0 24.0 angle 0.0 color_RGBA 255 255 255 255
if
  0 > 26@ 
jf @HUD_1922 
26@ += 360 
jump @HUD_1947

:HUD_1922
if 
  26@ > 359 
jf @HUD_1947 
26@ -= 360 

:HUD_1947
if or
 26@ > 349
 26@ < 11
jf @HUD_1948
if
not 26@ == 0
jf @HUD_1951
jump @HUD_2045

:HUD_1948
if and
 26@ > 79
 26@ < 101
jf @HUD_1949
if
not 26@ == 90
jf @HUD_1951
jump @HUD_2045

:HUD_1949
if and
 26@ > 169
 26@ < 191
jf @HUD_1950
if
not 26@ == 180
jf @HUD_1951
jump @HUD_2045

:HUD_1950 
if and
 26@ > 259
 26@ < 281
jf @HUD_1951  
if
not 26@ == 270
jf @HUD_1951
jump @HUD_2045

:HUD_1951  
if or
26@ == 0
26@ == 90
26@ == 180
26@ == 270
jf @HUD_2003
if
26@ == 0
then    
03E0: unknown_text_draw_flag 1 
0349: set_text_draw_font 2 
0348: enable_text_draw_proportional 1 
033F: set_text_draw_letter_size 0.125 0.75
0340: set_text_draw_RGBA 255 255 255 192
081C: draw_text_outline 0 RGBA 0 0 0 0
0342: enable_text_draw_centered 1
033E: set_draw_text_position 25@ 350.4 GXT 8@s 
jump @HUD_2045
end
if
26@ == 90    
then      
03E0: unknown_text_draw_flag 1 
0349: set_text_draw_font 2 
0348: enable_text_draw_proportional 1 
033F: set_text_draw_letter_size 0.125 0.75
0340: set_text_draw_RGBA 255 255 255 192
081C: draw_text_outline 0 RGBA 0 0 0 0
0342: enable_text_draw_centered 1
033E: set_draw_text_position 25@ 350.4 GXT 9@s
jump @HUD_2045 
end
if
26@ == 180
then      
03E0: unknown_text_draw_flag 1 
0349: set_text_draw_font 2 
0348: enable_text_draw_proportional 1 
033F: set_text_draw_letter_size 0.125 0.75
0340: set_text_draw_RGBA 255 255 255 192
081C: draw_text_outline 0 RGBA 0 0 0 0
0342: enable_text_draw_centered 1
033E: set_draw_text_position 25@ 350.4 GXT 13@s
jump @HUD_2045 
end
if
26@ == 270
then      
03E0: unknown_text_draw_flag 1 
0349: set_text_draw_font 2 
0348: enable_text_draw_proportional 1 
033F: set_text_draw_letter_size 0.125 0.75
0340: set_text_draw_RGBA 255 255 255 192
081C: draw_text_outline 0 RGBA 0 0 0 0
0342: enable_text_draw_centered 1
033E: set_draw_text_position 25@ 350.4 GXT 14@s
jump @HUD_2045 
end
/*03E0: unknown_text_draw_flag 1 
0349: set_text_draw_font 2 
0348: enable_text_draw_proportional 1 
033F: set_text_draw_letter_size 0.25 1.5
0340: set_text_draw_RGBA 0 255 255 192
081C: draw_text_outline 1 RGBA 0 0 0 255
0342: enable_text_draw_centered 1
045A: draw_text_1number 25@ 19.4 GXT 'NUMBER' number 26@*/ 
jump @HUD_2045

:HUD_2003
03E3: set_texture_to_be_drawn_antialiased 11@ 
074B: draw_texture 1 position 25@ 354.0 scale 1.0 1.0 angle 0.0 color_RGBA 255 255 255 255

:HUD_2045
30@ += 1 
if
  30@ > 60 //MITAD DE GRADOS VISIBLES 
jf @HUD_1724 
0092: 5@ = float 5@ to_integer 
//gosub @HUD_12921 
//045A: draw_text_1number 334.0 4.0 GXT 'NUMBER' number 5@
//0AB1: call_scm_func @Proportional_size 1 46.4 15@
//0AB1: call_scm_func @Proportional_size 1 25.6 16@
//005B: 16@ += 15@  // (float) 
//03E3: set_texture_to_be_drawn_antialiased 11@ 
//074B: draw_texture 25 position 16@ 330.4 scale 8.0 24.0 angle 0.0 color_RGBA 0 255 255 192
//0AB1: call_scm_func @Proportional_size 1 26.0 16@
//005B: 16@ += 15@  // (float)  
//03E3: set_texture_to_be_drawn_antialiased 11@ 
//074B: draw_texture 1 position 16@ 342.4 scale 68.0 2.0 angle 0.0 color_RGBA 0 255 255 192 
//03E3: set_texture_to_be_drawn_antialiased 11@ 
//074B: draw_texture 13 position 320.5 13.4 scale 64.0 29.9 angle 0.0 color_RGBA 0 255 255 192 
//03E3: set_texture_to_be_drawn_antialiased 11@ 
//074B: draw_texture 13 position 88.5 224.5 scale 64.0 29.9 angle 0.0 color_RGBA 0 255 255 192
//03E3: set_texture_to_be_drawn_antialiased 11@ 
//074B: draw_texture 13 position 552.5 224.5 scale 64.0 29.9 angle 0.0 color_RGBA 0 255 255 192 
0092: 28@ = float 21@ to_integer 
28@ /= 10 
0093: 28@ = integer 28@ to_float 
28@ *= -10.0 
if 
  21@ > 180.0 
jf @HUD_2389 
28@ += 360.0

:HUD_2389
28@ += -60.0 
jump @HUD_676









:HUD_12921
033F: set_text_draw_letter_size 0.3 1.8 
0340: set_text_draw_RGBA 0 255 255 192 
0342: enable_text_draw_centered 0 
0345: enable_text_draw_background 0 
0348: enable_text_draw_proportional 0 
03E4: enable_text_draw_align_right 1 
0349: set_text_draw_font 2 
081C: draw_text_outline 0 RGBA 0 0 0 0 
return 

:HUD_14383
0509: 27@ = distance_between_XY 28@ 29@ and_XY 0.0 0.0 
0073: 28@ /= 27@ // (float) 
0073: 29@ /= 27@ // (float) 
0509: 27@ = distance_between_XY 28@ 29@ and_XY 0.0 1.0 
30@ = 0 

:HUD_14448
27@ /= 2.0 
006B: 27@ *= 27@ // (float) 
0087: 29@ = 27@ // (float) 
27@ *= -1.0 
27@ += 1.0 
01FB: 27@ = square_root 27@ 
27@ *= -1.0 
27@ += 1.0 
006B: 27@ *= 27@ // (float) 
005B: 27@ += 29@ // (float) 
01FB: 27@ = square_root 27@ 
30@ += 1 
  30@ > 11 
jf @HUD_14448 
27@ *= 4096.0 
27@ /= 3.141529 
27@ *= 180.0 
if 
  28@ > 0.0 
jf @HUD_14638 
27@ *= -1.0 
27@ += 360.0 

:HUD_14638
return        
                          
:Proportional_size
0A8D: 1@ = read_memory 12677188 size 4 virtual_protect 0  //1680
0A8D: 2@ = read_memory 12677192 size 4 virtual_protect 0  //1050
0093: 1@ = integer 1@ to_float
1@ /= 640.0  //                                           2.625
//1@ = 640.0 
0093: 2@ = integer 2@ to_float
2@ /= 448.0
//2@ = 448.0 
0073: 2@ /= 1@ // (float) 
006B: 0@ *= 2@ // (float)
0AB2: ret 1 0@

:Proportional_size_x
0A8D: 1@ = read_memory 12677188 size 4 virtual_protect 0 
0093: 1@ = integer 1@ to_float
0@ *= 640.0
0073: 0@ /= 1@ // (float)
0AB2: ret 1 0@

:Proportional_size_y
0A8D: 2@ = read_memory 12677192 size 4 virtual_protect 0 
0093: 2@ = integer 2@ to_float
0@ *= 448.0
0073: 0@ /= 2@ // (float)
0AB2: ret 1 0@